/**
 * Dear programmer:
 * When I wrote this code, only god and I knew how it worked.
 * Now, only god knows it!
 *
 * @author: Pegasus  Date: 2018-11-28 Time: 22:40
 *
 * 分类标题
 */

import React, {Component} from 'react';
import {
  View,
  Text,
  StyleSheet,
  TouchableOpacity
} from 'react-native';
import PropTypes from 'prop-types';
import {COLOR_THEME, FONT_COLOR_TITLE} from "../../../../constant/PHColors"
import AntDesign from "react-native-vector-icons/AntDesign"

export default class SortTitleView extends Component {

  static propTypes = {
    title: PropTypes.string,
    onClick: PropTypes.func
  }

  render() {
    return (
      <TouchableOpacity activeOpacity={0.8} onPress={this.props.onClick}>
        <View style={styles.cellView}>
          <View style={styles.cellLeftView}>
            <Text>
              {this.props.title}
            </Text>
          </View>

          <View style={styles.cellRightView}>
            <AntDesign name={'right'} size={14} style={{color: COLOR_THEME}}/>
          </View>
        </View>
      </TouchableOpacity>
    )
  }
}

const styles = StyleSheet.create({
  cellView: {
    height: 40,
    flexDirection: 'row'
  },

  cellLeftView: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'flex-start',
    marginLeft: 15
  },

  cellRightView: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'flex-end',
    marginRight: 15
  }
})